Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): Ensures Maven proxy test is not infra dependant #5581

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

gansheer
Copy link
Contributor

@gansheer gansheer commented Jun 4, 2024

Modifications on maven http proxy test modification to avoid infra configuration dependance:

  • on passing test remove the kit copy and the CONNECT log verification on OCP: integration kit builds with proxy configuration should pass
  • add a non passing test with a non existant proxy: integration kit build should fail

Both test should be enought to prove the maven proxy test works.

Release Note

fix(e2e): Ensures Maven proxy test is not infra dependant

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. However I'd try to make an effort to remove platform specific conditions at all when we find them. We are already suffering this legacy situation and have difficulty to maintain the whole codebase. IMO, the negative test could be enough to prove that, when using a non existing proxy, the operator cannot build, therefore we may get rid off the "CONNECT" check condition.


if !ocp {
// OpenShift has internal configuration (like oauth) that overriddes the default repo connect URL
g.Expect(logs).To(ContainSubstring("\"CONNECT repo.maven.apache.org:443 HTTP/1.1\" 200"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid filling our code (also test code) with platform specific conditions. I think we need to find a general way to make a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the check but kept the passing test. I think proof of build with the proxy present goes by hand with the build error without the proxy. The proxy being test code driven makes it less infra dependant.
But if you think it is too much to maintain I can remove it as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine. What we should understand is if there is anything specific in the operator log that can make us check that we're connecting to a proxy. However, this could be something done at OS level, so, I think the reasoning on removing the check is fine by assuming that any third party will do its work. In theory, we should be fine by setting the env var and any tooling should be honoring such a configuration. However, Maven is a bit particular, and it requires an additional setting [1]. This is in fact something we are already doing, see:

func (proxyFromEnvironment) apply(settings *Settings) error {

A follow up work we can do (into this or after this PR) is to add some unit test to validate that, in presence of the HTTP_PROXY vars, the settings are created as expected. And the E2E can validate the presence of such configuration in the maven settings created next to the IntegrationPlatform.

[1] https://maven.apache.org/guides/mini/guide-proxies.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good ideas.
Let's merge this PR as it is and I will be adding some UT and improve the e2e configuration check in another PR.

@gansheer gansheer closed this Jun 5, 2024
@gansheer gansheer reopened this Jun 5, 2024
@gansheer gansheer requested a review from squakez June 5, 2024 12:02
@gansheer gansheer merged commit 348d61d into apache:main Jun 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants